AR	=ar
AS	=as --32
LD	=ld
LDFLAGS	=-s -x
CC	=gcc
CFLAGS	=-Wall -O -m32 -fstrength-reduce -fno-stack-protector -fomit-frame-pointer -finline-functions -nostdinc -I../../include
CPP	=gcc -E -nostdinc -I../../include

.c.s:
	$(CC) $(CFLAGS) \
	-S -o $*.s $<
.s.o:
	$(AS) -c -o $*.o $<
.c.o:
	$(CC) $(CFLAGS) \
	-c -o $*.o $<

OBJS  = tty_io.o console.o

chr_drv.a: $(OBJS)
	$(AR) rcs chr_drv.a $(OBJS)
	sync

clean:
	rm -f core *.o *.a tmp_make keyboard.s
	for i in *.c;do rm -f `basename $$i .c`.s;done

console.s console.o : console.c
tty_io.s tty_io.o : tty_io.c
